package com.wlhse.controller;

import com.wlhse.dto.inDto.ProblemImportInDto1;
import com.wlhse.service.ProblemImportService1;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController("ProblemController1")
@RequestMapping("/api/v1")
//问题录入
public class ProblemController1 {

    @Resource
    private ProblemImportService1 problemImportService1;

    @RequestMapping(value = "/tasks/check_info", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    public String returnCheck(@ModelAttribute ProblemImportInDto1 problemImportInDto1) {
        return problemImportService1.listCheck(problemImportInDto1);
    }

    @RequestMapping(value = "/plans/content", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    public String returnPlanContent(@ModelAttribute ProblemImportInDto1 problemImportInDto1) {
        return problemImportService1.listPlanContent(problemImportInDto1);
    }

    @RequestMapping(value = "/problem_descriptions", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    public String returnProblemDescription(@ModelAttribute ProblemImportInDto1 problemImportInDto1) {
        return problemImportService1.listProblemDescription(problemImportInDto1);
    }

    @RequestMapping(value = "/problem_descriptions/level", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    public String returnProblemRank(@ModelAttribute ProblemImportInDto1 problemImportInDto1) {
        return problemImportService1.listProblemRank(problemImportInDto1);
    }

    @RequestMapping(value = "/problems_class_level_one", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    public String returnProblemClass1() {
        return problemImportService1.listProblemClass1();
    }

    @RequestMapping(value = "/problems_class1/problems_level_two", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    public String returnProblemClass2(@ModelAttribute ProblemImportInDto1 problemImportInDto1) {
        return problemImportService1.listProblemClass2(problemImportInDto1);
    }

    @RequestMapping(value = "/problems/reason", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    public String returnProblemSource() {
        return problemImportService1.listProblemSource();
    }

    @RequestMapping(value = "/tasks/process", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    public String returnTaskAndProcess() {
        return problemImportService1.listTaskAndProcess();
    }

    @RequestMapping(value = "/processes/child_processes", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    public String returnProcess(@ModelAttribute ProblemImportInDto1 problemImportInDto1) {
        return problemImportService1.listProcess(problemImportInDto1);
    }
}
